import importlib
from typing import Any


def pydantic_moudle(moudle: str, to_moudle: str):
    m = importlib.import_module(moudle)
    return getattr(m, to_moudle)


def decorate(attr_name: str, to_moudle: Any):
    def decorate_fun(fun):
        setattr(fun, attr_name, to_moudle)
        return fun

    return decorate_fun
